package net.sf.xplore.ui.panel;

import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.Rectangle2D;

import javax.swing.JPanel;

import net.sf.xplore.ui.UiConstants.MenuContentColors;

public class MenuContentPanel extends JPanel {

	public MenuContentPanel() {
		setBackground(MenuContentColors.BACKGROUND);
		getInsets().set(7, 5, 5, 5);
	}
	
	
	@Override
	protected void paintBorder(Graphics graphics) {
		if(null == graphics)
			return;
		
		Graphics2D g = (Graphics2D) graphics;
		g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
		        RenderingHints.VALUE_ANTIALIAS_ON);
		
		g.setColor(MenuContentColors.OUTTER_BORDER);
		g.drawRect(getX(), getY(), getWidth(), getHeight());
		
		g.setColor(MenuContentColors.INNER_BORDER);
		g.drawRect(getX()+1, getY()+1, getWidth()-1, getHeight()-1);
		
	}

	@Override
	public void paint(Graphics graphics) {
		super.paint(graphics);
		if(null == graphics)
			return;
		/*Graphics2D g = (Graphics2D) graphics;
		g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
		        RenderingHints.VALUE_ANTIALIAS_ON);
		
		Rectangle2D r = new Rectangle2D.Double(getX()+2, getY()+2, getWidth()-3, getHeight()-3);
		GradientPaint gp = new GradientPaint(
				0, 0,
				MenuContentColors.BACKGROUND_GRAD_TOP, 
				0, getHeight(),
				MenuContentColors.BACKGROUND_GRAD_BOTTOM, true);
		
		g.setPaint(gp);
		g.fill(r);*/
		
	}

	
	
}
